<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>修改用户</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>
<script type="text/javascript" src="/EasyBuy/statics/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/EasyBuy/statics/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" >
	$(document).ready(function() {
	
		$("#bto").click(function (){
			var loginName=$("#loginName").val();
			var userName=$("#userName").val();
			var identityCode=$("#identityCode").val();
			var email=$("#email").val();
			var mobile=$("#phone").val();
			var type=$("#type").val();
			var id=$("#id").val();
			location.href="UserServlet?opr=update&loginName="+loginName+"&userName="+userName
					+"&identityCode="+identityCode+"&email="+email+"&mobile="+mobile+"&type="+type+"&id="+id;
		});
	});
</script>
  <body>
  	<%@ include file="../../common/header.jsp" %>	
	<%@ include file="../../common/backendHeader.jsp" %>
  	
  	<c:choose>
		<c:when test="${empty applicationScope.type }">
			<% 	request.getRequestDispatcher("../../UserServlet?opr=type&href=Member_User_Update&href1=user").forward(request, response); %>
		</c:when>
		<c:otherwise>
			<c:if test="${applicationScope.type==1 }">
  				<%@ include file="../../common/sideMamber.jsp" %> 
			</c:if>
			<c:if test="${applicationScope.type==0 }">
				<%@ include file="../../common/sideUser.jsp" %> 
			</c:if>
		</c:otherwise>
	 </c:choose>
  	
  	    
  <div class="m_right">
  <span style="margin-left:25px;"><font size=4>修改用户</font></span>
   <table border="0" id="admin" class="order_tab" style="width:530px;margin-top:50px; margin-bottom:30px;" cellspacing="0" cellpadding="0">
		<c:forEach var="list" items="${list }">
			<input type="text" id="id" value="${list.id }" style="display:none">
			<tr style="height:40px">
				<td style=" text-align:right;">用户姓名</td><td><input type="text" value="${list.loginName }" name="loginName"  id="loginName"/></td>
			</tr>
			<tr  style="height:40px">
				<td style=" text-align:right;">真实姓名</td><td><input type="text" value="${list.userName }" name="userName" id="userName"/></td>
			</tr>
			<tr  style="height:40px">
				<td style=" text-align:right;">身份证号</td><td><input type="text" value="${list.identityCode }" name="identityCode" id="identityCode"/></td>
			</tr>
			<tr  style="height:40px">
				<td style=" text-align:right;">电子邮箱</td><td><input type="text" value="${list.email }" name="email" id="email"/></td>
			</tr>
			<tr style="height:40px">
				<td style=" text-align:right;">手机</td><td><input type="text" value="${list.mobile }" name="phone" id="phone"/></td>
			</tr>
			<c:if test="${list.type=='1'}">
				<tr style="height:40px">
					<td style=" text-align:right;">用户类型 </td>
					<td>
						<select name="type" id="type">
							<option value="">请选择</option>
							<option value="1" selected>管理员</option>
							<option value="0">用户</option>
						</select>
					</td>
				</tr>
			</c:if>
			<c:if test="${list.type=='0'}">
				<tr style="height:40px">
					<td style=" text-align:right;">用户类型 </td>
					<td>
						<select name="type" id="type">
							<option value="">请选择</option>
							<option value="1" >管理员</option>
							<option value="0" selected>用户</option>
						</select>
					</td>
				</tr>
			</c:if>
			<tr style="height:40px">
				<td></td><td><input style="height:30px" id="bto" type="button" value="修改信息" /></td>
			</tr>
		</c:forEach>
	</table>
  </div>
  <%@ include file="../../common/footer.jsp" %>    <!--引入下边栏-->
  </body>
</html>
